/**
 * Created by Administrator on 2017/1/11.
 */
import {Component,OnInit} from "@angular/core";
import {Router,ActivatedRoute} from "@angular/router";
import {SecondService} from "./service/second.service";
@Component({
  selector : "second",
  styleUrls : ["./second.less"],
  templateUrl:"./second.html",
  providers:[SecondService]
})

export class SecondComponent implements OnInit{
  secondInfoData:any;
  type : string;
  constructor(private router:Router,private ar :ActivatedRoute,private secondService:SecondService){

  }
  ngOnInit(){
    // this can change the params by other ....
    //this.type = this.router.currentUrlTree ? this.router.currentUrlTree.queryParams.type : "lol";

    console.log("second module, ",this.ar.snapshot.queryParams);
    this.type = this.ar.snapshot.queryParams ? this.ar.snapshot.queryParams["type"] : "lol";
  }
  goback() : void {
    console.log("goback");
    this.router.navigate(['/home']);
  }
}
